/*
Abstract:
  Helper for working with headers and footers

Last changed:
  $Id: header_footer_supp.h 82 2009-12-08 20:53:44Z vitamin.caig $

Author:
  (C) Vitamin/CAIG/2001

  This file is the part of Textator project
*/
#ifndef __HEADER_FOOTER_H_DEFINED__
#define __HEADER_FOOTER_H_DEFINED__

#include <types.h>

#include <memory>

namespace IO
{
  class TargetStream;
}

namespace Output
{
  class HeaderFooterController
  {
  public:
    typedef std::auto_ptr<HeaderFooterController> Ptr;

    virtual ~HeaderFooterController()
    {
    }

    //return true if entry is accepted and shouldn't be processed further
    virtual bool ParseEntry(const String& name, const String& value) = 0;
    
    virtual void PutHeader(IO::TargetStream& stream) const = 0;
    virtual void PutFooter(IO::TargetStream& stream) const = 0;
  };

  HeaderFooterController::Ptr CreateBlockController(const String& format);
  HeaderFooterController::Ptr CreatePerLineController(const String& format);
}

#endif //__HEADER_FOOTER_H_DEFINED__

